<template>
<div class="goods-item" @click='itemclick'>
   <img :src="goodsitem.show.img" alt="">
  <div class="goods-info">
  <p>{{goodsitem.title}}</p>
  <span class="price">￥{{goodsitem.price}}</span>
  <span class="collect">❤{{goodsitem.cfav}}</span>
  </div>
</div>

</template>

<script>
export default {
  name:'goodslistitem',
        methods:{
        itemclick(){
          this.$router.push('/detail/'+this.goodsitem.iid)
        }
      },
  props:{
    goodsitem:{
      type:Object,
    }
  }
}
</script>

<style scoped>

  .goods-item{
    padding-bottom: 40px;
    position: relative;
    width: 48%;
  }

  .goods-item img{
    width: 100%;
    border-radius: 5px;
  }

  .goods-info{
    font-size: 12px;
    position: absolute;
    bottom: 5px;
    left: 0;
    right: 0;
    overflow: hidden;
    text-align: center;
  }

  .goods-info p{
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 3px;
  }

  .goods-info .price{
    margin-right: 20px;
    color: red;
  }

  .goods-info .collect{
    position: relative;
    color: hotpink;

  }
</style>
